<?php include("includes/header.php"); ?>

<style>
#page_container
{
  background-color: transparent;
}
#create_account_container{
  margin:100px auto;
  border: 1px solid #5f0808;
  width: 500px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;

}
#account_form_title
{
  background-color: #5f0808;
  height: 25px;
  width: 100%;
  text-align: center;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;

}
#account_form_title h3
{
  color: #f9f9f9;
  padding: 0px;
  margin: 0px;
}

#account_form
{
  margin: 20px auto;
  width: 200px;
}
#account_form_footer
{
  margin-top: 20px;
  text-align: center;
  margin-bottom: 20px;
}
#account_form_footer a
{
  color: #5f0808;
}
.error
{
  color: red;
  font-size: 80%;
  text-align: center;
}
</style>

<div id="create_account_container">
  <div id="account_form_title"><h3>Create Account</h3></div>

  <?php
  
  /* When the user incorrectly enters information to create an account, they are sent back
   * here with specific error messages about what went wrong.
   */
  if(isset($_GET['err']) && $_GET['err'] == 1)
  {
    echo '<p class="error">Your passwords did not match.  Please try again.</p>';
  }
  else if(isset($_GET['err']) && $_GET['err'] == 2)
  {
    echo '<p class="error">Sorry, that account name has already been taken.</p>';
  }
  else if(isset($_GET['err']) && $_GET['err'] == 3)
  {
    echo '<p class="error">Please make sure all fields are filled out before submitting.</p>';
  }

  ?>
  <form id="account_form" action="php/account_handler.php" method="POST">
    <label>Email(Username): </label><br />
      <input type="email" name="email" required autofocus/><p></p>
    <label>Password: </label><br />
      <input type="password" name="pw1" required/><p></p>
    <label>Confirm Password: </label><br />
      <input type="password" name="pw2" required/><p></p>
      <input type="submit" style="float:right" value="Register" /><p></p>
  </form>
  
  <div style="clear:both"></div>

  <div id="account_form_footer">
     <a href="password_forgot.php">Reset password</a> | <a href="Login.php">Login</a>
  </div>
</div>

<!--
<img src="images/create_placeholder.png" />
-->
<?php include("includes/footer.php"); ?>
